package android.Spider;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.CycleInterpolator;
import android.widget.ImageView;
import android.widget.ViewAnimator;

public class Luncher extends Activity implements Animation.AnimationListener
{

	@Override
	protected void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		
		setContentView(R.layout.splash);
		m_img = (ImageView)findViewById(R.id.SplashSwitcher);
		m_img.setVisibility(View.INVISIBLE);
		
		m_animator = new ViewAnimator(this);
		m_animator.addView((ImageView)findViewById(R.id.SplashEmpty));
		m_animator.addView(m_img);
		
		AlphaAnimation inAnim = new AlphaAnimation(0.0f, 1.0f);
		inAnim.setInterpolator(new CycleInterpolator(0.5f));
		inAnim.setDuration(5000);
		inAnim.setAnimationListener(this);
		m_animator.setInAnimation(inAnim);

		m_animator.showNext();
	}

	@Override
	public void onAnimationEnd()
	{
		Intent intent = new Intent(this, Broodmother.class);
		startActivity(intent);
		finish();
	}
	
	@Override
	public void onAnimationRepeat() {
	}
	@Override
	public void onAnimationStart() {
	}

	ImageView m_img;
	ViewAnimator m_animator;
}
